</body>

<script type="text/javascript">

    function menuOpen() {
        // Show menu
        document.getElementById("header-menu").classList.add('flex');
        document.getElementById("header-menu").classList.remove('hidden');

        // Hide hamburger
        document.getElementById("header-menu-open").classList.add('hidden');
        document.getElementById("header-menu-open").classList.remove('flex');

        // Show close btn
        document.getElementById("header-menu-close").classList.add('flex');
        document.getElementById("header-menu-close").classList.remove('hidden');

        // Hide logo
        document.getElementById("header-logo").classList.add('hidden');
    }

    function menuClose() {
        // Hide menu
        document.getElementById("header-menu").classList.add('hidden');
        document.getElementById("header-menu").classList.remove('flex');

        // Show hamburger
        document.getElementById("header-menu-open").classList.add('flex');
        document.getElementById("header-menu-open").classList.remove('hidden');

        // Hide close btn
        document.getElementById("header-menu-close").classList.add('hidden');
        document.getElementById("header-menu-close").classList.remove('flex');

        // Show logo
        document.getElementById("header-logo").classList.remove('hidden');
    }
</script>
<script src="/template/js/jquery.js"></script>
<script src="/template/js/jquery.cycle2.min.js"></script>
<script src="/template/js/jquery.cycle2.carousel.min.js"></script>
<script src="/template/js/bootstrap.min.js"></script>
<script src="/template/js/jquery.scrollUp.min.js"></script>
<script src="/template/js/price-range.js"></script>
<script src="/template/js/jquery.prettyPhoto.js"></script>
<script src="/template/js/main.js"></script>
<script>
    $(document).ready(function () {
        $(".add-to-cart").click(function () {
            var id = $(this).attr("data-id");
            $.post("/cart/addAjax/" + id, {}, function (data) {
                $("#cart-count").html(data);
                console.log(data);
            });
            return false;
        });
    });
</script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.8/dist/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                search: '',
                todos: [],
            };
        },
        computed: {
            todosByTitle() {
                return this.todos.filter(item => item.name.indexOf(this.search) !== -1)
            },
        },
        beforeMount() {
            fetch('http://localhost/product/search')
                .then(response => response.json())
                .then(json => {
                    this.todos = json;
                })
        },
    })
</script>
</html>
